<?php
$this->breadcrumbs = array(
	'Sự kiện'=>array('/Events/default/index'),
	'Nhãn sự kiện'
);
?>

<!-- BEGIN PORTLET-->
<div class="row">
	<div class="col-md-12">
        <div class="portlet">
        	<div class="portlet-title">
            	<div class="caption"><i class="icon-add"></i> Thêm nhãn sự kiện</div>
            </div>
            <div class="portlet-body">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'label-form',
	'action'=>array('/Events/labels/create'),
	'enableClientValidation'=>false,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
	'htmlOptions'=>array(
		'class'=>'horizontal-form',
	),
)); ?>
<div class="form-body">
	<div class="row">
    	<div class="col-md-9">
            <div class="form-group">
                <?php echo $form->textField($model, 'title', array('class'=>'form-control')); ?>
            </div>
            <div class="form-group <?php echo ($seotool->getError('title') ? 'has-error' : ''); ?>">
                <?php echo $form->labelEx($seotool, 'title', array('class'=>'control-label')); ?>
                <?php echo $form->textField($seotool, 'title', array('class'=>'form-control')); ?>
                <?php echo $form->error($seotool, 'title', array('class'=>'help-block')); ?>
            </div>
            
            <div class="form-group <?php echo ($seotool->getError('description') ? 'has-error' : ''); ?>">
                <?php echo $form->labelEx($seotool, 'description', array('class'=>'control-label')); ?>
                <?php echo $form->textArea($seotool, 'description', array('class'=>'form-control', 'rows'=>5)); ?>
                <?php echo $form->error($seotool, 'description', array('class'=>'help-block')); ?>
            </div>
            
            <div class="form-group <?php echo ($seotool->getError('keywords') ? 'has-error' : ''); ?>">
                <?php echo $form->labelEx($seotool, 'keywords', array('class'=>'control-label')); ?>
                <?php echo $form->textField($seotool, 'keywords', array('class'=>'form-control')); ?>
                <?php echo $form->error($seotool, 'keywords', array('class'=>'help-block')); ?>
            </div>
		</div>
        <div class="col-md-3">
            <button type="submit" class="btn blue" onClick="Custom.showLoading();"><i class="icon-ok"></i> Thêm mới</button>
            <button type="reset" class="btn default">Cancel</button>
        </div>
	</div>
</div>
<?php $this->endWidget(); ?>
            </div>
        </div>

    	<div class="portlet">
        	<div class="portlet-title">
            	<div class="caption"><i class="icon-bar-chart"></i>Danh sách nhãn sự kiện</div>
            </div>
            <div class="portlet-body">
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'slide-grid',
	'dataProvider'=>$dataProvider,
	//'filter'=>$reports,
	'itemsCssClass'=>'table table-striped table-bordered table-advance table-hover',
	//'pagerCssClass'=>'pagination pagination-sm',
	'pager'=>array(
        'header'=>'',
		'maxButtonCount'=>10,
        'header'=>'',
        'prevPageLabel'=>'<i class="icon-angle-left"></i></a>',
        'nextPageLabel'=>'<i class="icon-angle-right"></i></a>',
        'firstPageLabel'=>'First',
        'lastPageLabel'=>'Last',
        'footer'=>'',
		'selectedPageCssClass'=>'active',
		'hiddenPageCssClass'=>'disabled',
        'htmlOptions'=>array(
            'class'=>'pagination pagination-sm',
        ),
    ),
	'columns'=>array(
		'id',
		'title',
		'slug',
		array(
			'name'=>'posteddate',
			'value'=>'date("d-m-Y H:i:s", strtotime($data->posteddate))',
		),
		array(
			'class'=>'CButtonColumn',
			'header'=>'Action',
			'template'=>'{view} {update} {delete}',
			'buttons'=>array
			(
				'view'=>array(
					'label'=>'<i class="icon-share"></i>',
					'imageUrl'=>false,
					'url'=>'array("/Events/labels/view", "slug"=>$data->slug)',
					'options'=>array(
						'class'=>'btn default btn-xs blue',
						'title'=>'View'
					),
				),
				'update'=>array(
					'label'=>'<i class="icon-edit"></i>',
					'imageUrl'=>false,
					'url'=>'array("/Events/labels/update", "slug"=>$data->slug)',
					'options'=>array(
						'class'=>'btn default btn-xs green',
						'title'=>'Edit'
					),
				),
				'delete'=>array(
					'label'=>'<i class="icon-trash"></i>',
					'imageUrl'=>false,
					'url'=>'array("/Events/labels/delete", "id"=>$data->id)',
					'options'=>array(
						'class'=>'btn default btn-xs black',
						'title'=>'Xóa khỏi slide'
					),
				),
			),
			'htmlOptions'=>array(
				'width'=>'100px',
				'class'=>'text-center'
			),
		),
	),
	'htmlOptions'=>array(
		'class'=>''
	),
)); ?>
            </div>
        </div>
    </div>
</div>
<!-- END PORTLET-->